<template>
  <scoring-template :initData="initData" :title="title" @save="getAddData">
  </scoring-template>
</template>

<script>
  import ScoringTemplate from '../../base/quality-template/ScoringForm'
  export default {
    name: 'AddScoringTemplate',
    data () {
      return {
        title: this.$t('configLazyLoad.qualityCheck.addScoringTemplate'),
        initData: {
          _id: '',
          enable: '',
          name: '',
          QUALITY_TYPE: 'qualityCall',
          memo: '',
          'A-begin': 95,
          'B-begin': 80,
          'B-end': 94,
          'C-begin': 60,
          'C-end': 79,
          'D-end': 59,
          gradeConfig:[
            {
              name:this.$t('qualityCheck.excellent'),
              'begin': 95,
              'end':100
            },
            {
              name:this.$t('qualityCheck.qualified'),
              'begin': 80,
              'end': 94
            },
            {
              name:this.$t('qualityCheck.remind'),
              'begin': 60,
              'end': 79
            },
            {
              name:this.$t('qualityCheck.unqualified'),
              'end': 59,
              'begin': 0
            }
          ],
          config: [{
            order: 1,
            name: this.$t('configLazyLoad.qualityCheck.professionalLevel'),
            weight: 40
          }, {
            order: 2,
            name: this.$t('configLazyLoad.qualityCheck.attitude&tone'),
            weight: 30
          }, {
            order: 3,
            name: this.$t('configLazyLoad.qualityCheck.solutionLevel'),
            weight: 30
          }]
        }
      }
    },
    components: {
      ScoringTemplate
    },
    methods: {
      getAddData (data) {
        this.$emit('add', data)
      }
    }
  }
</script>